#include<string.h>
#include <stdio.h>
#include "Singleton.h"
#include "Factory.h"
#include "Builder.h"
#include "Adapter.h"
#include "Decorator.h"
#include "Strategy.h"
#include "Proxy.h"
#include "Template_Method.h"

int main(int argc, char const *argv[])
{

/*******************************  代理模式 START ******************************************/
// /*
    Worker* lilei = new IT("lilei");
    Worker* zhangsan = new QA("zhangsan");
    Worker* wangqiang = new HR("wangqiang");

    lilei->workOneDay();
    zhangsan->workOneDay();
    wangqiang->workOneDay();
// */
/*******************************  代理模式 END ******************************************/

/*******************************  代理模式 START ******************************************/
/*
    Proxy* proxy = new Proxy(new ConcreteClass2);
    proxy->app1();
    proxy->app2();
    delete proxy;
*/
/*******************************  代理模式 END ******************************************/

/*******************************  策略模式 START ******************************************/
/*
    Stragey_Context* ctx = new Stragey_Context(new ProcessB);
    ctx->toHandleProcess();
    delete ctx;
*/
/*******************************  策略模式 END ******************************************/

/*******************************  装饰器模式 START ******************************************/
/*
    RedShapeDecorator* decorator = new RedShapeDecorator(new Rectangle);
    decorator->draw();
    delete decorator;

    decorator = new RedShapeDecorator(new Cycle);
    decorator->draw();
    delete decorator;
*/
/*******************************  装饰器模式 END ******************************************/

/*******************************  适配器模式 START ******************************************/
/*
    Adapter_class* target = new Adapter_class();
    target->app1();
    target->app2();
    delete target;

    Source* pSource;
    Target2* target2 = new Adapter_object(pSource);
    target2->app1();
    target2->app2();
    delete target2;

    Base_port* port = new child1();
    port->app1();
    port->app3();
    delete port;

    port = new child2();
    port->app1();
    port->app2();
    port->app3(); //It will call the func in class Base_port
    port->app4();
*/
/*******************************  适配器模式 END ******************************************/

/*******************************  单例模式 START ******************************************/
/*
    singleton_hungury* instance = singleton_hungury::GetInstance();
    instance->showInfo();

    singleton_hungury* instance2 = singleton_hungury::GetInstance();
    instance2->showInfo();

    singleton_lazy* instance_lazy = singleton_lazy::Getinstance();
    instance_lazy->showInfo();

    singleton_lazy* instance_lazy2 = singleton_lazy::Getinstance();
    instance_lazy2->showInfo();
*/
/*******************************  单例模式 END ******************************************/

/*******************************  工厂模式 START ******************************************/
/*
    SenderBase* sender = Facotry_Normal::CreateSender(SENDER_A);
    if(sender)
    {
        sender->send();
        delete sender;
    }

    sender = Facotry_Normal::CreateSender(SENDER_B);
    if(sender)
    {
        sender->send();
        delete sender;
    }

    sender = Facotry_Normal::CreateSender((EN_SENDER_TYPE)10);
    if(sender)
    {
        sender->send();
        delete sender;
    }

    sender = Facotry_Multi::CreaterSenderA();
    if(sender)
    {
        sender->send();
        delete sender;
    }
    sender = Facotry_Multi::CreaterSenderB();
    if(sender)
    {
        sender->send();
        delete sender;
    }

    Factory_Base* factory = new Factory_SenderA();
    sender = factory->CreateFactory();
    if(sender)
    {
        sender->send();
        delete sender;
    }
    delete factory;

    factory = new Factory_SenderB();
    sender = factory->CreateFactory();
    if(sender)
    {
        sender->send();
        delete sender;
    }
    delete factory;
*/
/*******************************  工厂模式 END ******************************************/

/*******************************  构建者模式 START ******************************************/
/*
    BuilderBase* builder = new HuaweiComputerBuilder();
    Director::produceComputer(builder);
    Computer* computer = builder->getComputer();
    computer->showComponets();
*/
/*******************************  构建者模式 END ******************************************/
    printf("Exit\n");
    return 0;
}
